<!DOCTYPE html>
<title>This test ensures that when an image changes, but doesn't change size (like in an Animated GIF), we don't force a Layout.</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<div style="float: left;">
<img style="max-width: 100%" src="../fast/replaced/resources/1x1-blue.png">
</div>
<script>
async_test(function(t) {
    window.onload = t.step_func(function() {
        document.documentElement.offsetTop;
        var img = document.querySelector("img");
        img.src = "";
        assert_equals(internals.needsLayoutCount(), 0);
        img.onload = t.step_func_done(function() {
            assert_equals(internals.needsLayoutCount(), 0);
        });
    });
});
</script>
